#include<stdio.h>
#include<stdlib.h>

struct STU
{
	long long stu_num;
	char name[21];
	int chi,math,eng;
};

int main(void)
{
	int n,flag=0;
	long long refer;
	scanf("%d",&n);
	struct STU stu[n];
	for(int i=0;i<n;i++)
	{
		scanf("%lld %s %d %d %d",&stu[i].stu_num,stu[i].name,&stu[i].chi,&stu[i].math,&stu[i].eng);
	}
	scanf("%lld",&refer);
	for(int i=0;i<n;i++)
	{
		if(stu[i].stu_num==refer)
		{
			printf("%lld %s %d %d %d",stu[i].stu_num,stu[i].name,stu[i].chi,stu[i].math,stu[i].eng);
			flag=1;
		}
	}
	
	if(!flag)
	{
		printf("Not Found");
	}
	
	return 0;
}

